package com.woniu.car.Util;

import com.woniu.car.common.ResponseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class PageResult<D> extends ResponseEntity {
    //总条数
    private int totalCount;
    //总页数
    private int pageCount;
    //当前页
    private int pageIdx;
    //页容量
    private int pageSize;
    //当前页内容 查询到的course集合
    private List<D> content;

    public PageResult(int totalCount, int pageIdx, int pageSize, List<D> content){
        this.content=content;
        this.pageIdx=pageIdx;
        this.pageSize=pageSize;
        this.totalCount=totalCount;

        this.pageCount = totalCount%pageSize==0?totalCount/pageSize:(totalCount/pageSize+1);
    }


}
